# Project:	MapReduce
# Author:	gong_libin
# Date:		2013_05_06

CC = g++
CFLAGS = -g -Wall

MR_ENV = $(shell pwd)
MR_BIN = $(MR_ENV)/bin
MR_INC = $(MR_ENV)/inc
MR_SRC = $(MR_ENV)/src

MR_GLIB = /usr/lib64
MR_GINC = /usr/include/MrInc

MYSQL_INC = /usr/include/mysql
MYSQL_LIB = /usr/lib/mysql

PGSQL_INC = /usr/include/pgsql
PGSQL_LIB = /usr/lib/pgsql

ORACLE_INC = /usr/include/oracle
ORACLE_LIB = /usr/lib/oracle

export CC
export CFLAGS

export MR_ENV
export MR_BIN
export MR_INC
export MR_SRC

export MR_GLIB
export MR_GINC

export MYSQL_INC
export MYSQL_LIB
export PGSQL_INC
export PGSQL_LIB
export ORACLE_INC
export ORACLE_LIB

.PHONY: bin src test

all: bin src test

bin:
	if test -d $(MR_BIN); then true; else mkdir $(MR_BIN); fi;

src:
	$(MAKE) -C $(MR_SRC)/MrSql
	$(MAKE) -C $(MR_SRC)/MrSquid

test:
	$(MAKE) -C test

clean:
	$(MAKE) clean -C $(MR_SRC)/MrSquid
	$(MAKE) clean -C $(MR_SRC)/MrSql
	$(MAKE) clean -C test
	rm -rf $(MR_BIN)
